package com.base.grammardemo;
import java.util.Scanner;

/*
 * 键盘输入字符串并进行判断
 */
public class SwitchString {
	static String name;
	static char sex;
	static short age;
	static float height;
	static String type;
	
	public static void main(String[] args) {
		// TODO 自动生成的方法存根
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入分数等级:");
        char grade = scanner.next().charAt(0);
        switch(grade){
          case '优':
        	  System.out.println(5);
        	  break;
          case '良':
          	  System.out.println(4);
          	  break;
          case '中':
              System.out.println(3);
              break;
          case '差':
              System.out.println(2);
              break;
          default:
        	  System.out.println("输入的等级错误");
        }	
	}
}